Skip to content

Fix menu not closing when clicking tabs#818

Merged
krassowski merged 5 commits into
jupyterlab:mainfrom
Darshan808:fix-menu-closing
May 22, 2026
Merged

Fix menu not closing when clicking tabs#818
krassowski merged 5 commits into
jupyterlab:mainfrom
Darshan808:fix-menu-closing

Conversation

@Darshan808

Copy link
Copy Markdown
Member

Fixes jupyterlab/jupyterlab#18851

Description

Switch document listener from mousedown to pointerdown so outside clicks are detected even when tab clicks call
preventDefault(), which was blocking the old event flow.

Before:

Screen.Recording.2026-05-18.at.14.37.07.mov

After:

Screen.Recording.2026-05-18.at.14.38.05.mov

Comment thread packages/widgets/src/menu.ts
@Darshan808 Darshan808 requested a review from krassowski May 20, 2026 10:12

@krassowski krassowski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Another very long shot but @afshin any chance you recall why this was not changed in lumino v2 PR? More likely forgotten about or was there a reason not to do it?

@krassowski krassowski changed the title Fix menu not closing when clicking tabs. Fix menu not closing when clicking tabs May 22, 2026
@krassowski krassowski merged commit 37cfeb1 into jupyterlab:main May 22, 2026
18 checks passed
@afshin

afshin commented May 22, 2026

Copy link
Copy Markdown
Member

@krassowski @Darshan808 I can't remember a reason. I think this change is good. It's possible I was being cautious for some now-forgotten reason. It's possible it was just an omission, but it's pretty big, so I think it was more likely caution than anything else. Thanks for the updates!

jtpio pushed a commit to jupyterlab/jupyterlab that referenced this pull request May 26, 2026
## References

- brings the enhancement requested in
#10514
 - follow-up to #18703

## Code changes

None

## User-facing changes

Pulls fixes for two bugs:
- jupyterlab/lumino#819
- jupyterlab/lumino#818

And makes closing multiple tabs easier:
- jupyterlab/lumino#793



https://github.com/user-attachments/assets/18fb096e-b48c-4a27-a5b4-c459cfc147de



## Backwards-incompatible changes

None

## AI usage

None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Menus Remain Open When Clicking Interface Buttons

3 participants